from common.base import Base, By


class LoginPage(Base):
    """
    封装的用户登录操作,继承了Base
    """

    def input_username(self, username):
        # 输入用户名
        self.find_element((By.NAME, 'username')).send_keys(username)

    def input_password(self, password):
        # 输入密码
        self.find_element((By.NAME, 'password')).send_keys(password)

    def input_remember(self):
        # 勾选保存登录信息
        self.click((By.ID, 'remember'))

    def input_submit(self):
        # 点击登录按键
        self.click((By.CLASS_NAME, 'loginbtn'))
